package com.company.keep;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    static class Pair implements Comparable{
        int start;
        int end;

        public Pair(int start, int end) {
            this.start = start;
            this.end = end;
        }

        @Override
        public int compareTo(Object o) {
            Pair pair = (Pair) o;
            int r = this.start - pair.start;
            if(r != 0){
                return r;
            }else{
                return this.end - pair.end;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner( System.in);
        String line = sc.nextLine();
        String[] pairStrs = line.split(" ");
        List<Pair> pairList = new ArrayList<>();
        for(int i = 0; i < pairStrs.length; i++){
            String[] pairStr = pairStrs[i].split(",");
            Pair pair = new Pair(Integer.parseInt(pairStr[0]), Integer.parseInt(pairStr[1]));
            pairList.add(pair);
        }
        Collections.sort(pairList);
        boolean flag = true;
        if(pairList.size() <= 1){
            System.out.println(true);
        }else{
            for(int i = 1; i < pairList.size(); i++){
                Pair last = pairList.get(i - 1);
                Pair curr = pairList.get(i);
                if(last.end > curr.start){
                    System.out.println(false);
                    return;
                }
            }
            System.out.println(flag);
        }
    }

}
